import { useState, useEffect } from 'react';
import axios from 'axios';

// 模拟数据
const mock = [
  { id: 1, name: '小明啊', stars: 5 },
  { id: 2, name: '小红', stars: 8 },
  { id: 3, name: '小刚', stars: 3 },
];

export default function useStudentStars() {
  const [data, setData] = useState([]);
  const [loading, setLoading] = useState(true);

  useEffect(() => {
    // 1. 先给假数据
    setData(mock);
    setLoading(false);

  }, []);

  return { data, loading };
}